package org.gap.domain;

import java.io.Serializable;

import javax.persistence.Id;

import javax.persistence.*;

/**
 */
public class RelationsTiersPK implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 */
	public RelationsTiersPK() {
	}

	/**
	 */

	@Column(name = "RLT_TIERS_PARENT", nullable = false)
	@Basic(fetch = FetchType.EAGER)
	@Id
	public Integer rltTiersParent;
	/**
	 */

	@Column(name = "RLT_TIERS_FILS", nullable = false)
	@Basic(fetch = FetchType.EAGER)
	@Id
	public Integer rltTiersFils;
	/**
	 */

	@Column(name = "RLT_RELATION", length = 3, nullable = false)
	@Basic(fetch = FetchType.EAGER)
	@Id
	public String rltRelation;

	/**
	 */
	public void setRltTiersParent(Integer rltTiersParent) {
		this.rltTiersParent = rltTiersParent;
	}

	/**
	 */
	public Integer getRltTiersParent() {
		return this.rltTiersParent;
	}

	/**
	 */
	public void setRltTiersFils(Integer rltTiersFils) {
		this.rltTiersFils = rltTiersFils;
	}

	/**
	 */
	public Integer getRltTiersFils() {
		return this.rltTiersFils;
	}

	/**
	 */
	public void setRltRelation(String rltRelation) {
		this.rltRelation = rltRelation;
	}

	/**
	 */
	public String getRltRelation() {
		return this.rltRelation;
	}

	/**
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = (int) (prime * result + ((rltTiersParent == null) ? 0 : rltTiersParent.hashCode()));
		result = (int) (prime * result + ((rltTiersFils == null) ? 0 : rltTiersFils.hashCode()));
		result = (int) (prime * result + ((rltRelation == null) ? 0 : rltRelation.hashCode()));
		return result;
	}

	/**
	 */
	public boolean equals(Object obj) {
		if (obj == this)
			return true;
		if (!(obj instanceof RelationsTiersPK))
			return false;
		RelationsTiersPK equalCheck = (RelationsTiersPK) obj;
		if ((rltTiersParent == null && equalCheck.rltTiersParent != null) || (rltTiersParent != null && equalCheck.rltTiersParent == null))
			return false;
		if (rltTiersParent != null && !rltTiersParent.equals(equalCheck.rltTiersParent))
			return false;
		if ((rltTiersFils == null && equalCheck.rltTiersFils != null) || (rltTiersFils != null && equalCheck.rltTiersFils == null))
			return false;
		if (rltTiersFils != null && !rltTiersFils.equals(equalCheck.rltTiersFils))
			return false;
		if ((rltRelation == null && equalCheck.rltRelation != null) || (rltRelation != null && equalCheck.rltRelation == null))
			return false;
		if (rltRelation != null && !rltRelation.equals(equalCheck.rltRelation))
			return false;
		return true;
	}

	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder("RelationsTiersPK");
		sb.append(" rltTiersParent: ").append(getRltTiersParent());
		sb.append(" rltTiersFils: ").append(getRltTiersFils());
		sb.append(" rltRelation: ").append(getRltRelation());
		return sb.toString();
	}
}
